package com.example.springboot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springboot.entity.Emp;
import com.example.springboot.service.IEmpService;
import com.example.springboot.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/emp")
@CrossOrigin
public class EmpController {

    @Resource
    private IEmpService service;

    @PostMapping
    public Result getAll(Page page, Emp emp){
        return service.getall(page,emp);
    }
    @DeleteMapping("{id}")
    public Result delId(@PathVariable Integer id){
        return new Result(service.delId(id));
    }
}
